<template>
	<view class="box">
		<view class="box_top">
			<text>预存运费</text>
		</view>
		<view class="content">
			<view class="content_shang">
				<view class="zhong">
					<view class="zhong_shang">
						<view class="shang_text">
							本次发布货源需预存运费
						</view>
						<view class="shang_text">
							<text>结算主体：山西创盟星河科技有限公司</text>
						</view>
					</view>
					<view class="zhong_zhong">
						<view class="zhong_text">
							<text>运费金额</text>
						</view>
					</view>
					<view class="zhong_xia">
						<view class="fee_details">
							<text class="amount">￥</text>
							<text class="amount">{{ paymentInfo.feeAmount }}</text>
						</view>
						<view class="fee_details">
							<text>含税运费：{{ paymentInfo.taxFee }}元</text>
						</view>
						<view class="fee_details">
							<text>保证金：{{ paymentInfo.depositFee }}元</text>
						</view>
					</view>
					<view class="balance">
						<text>可用余额(元)</text>
						<text>{{ paymentInfo.availableBalance }}</text>
					</view>
				</view>
			</view>
			<view class="content_xia">
				<view class="buttons">
					<button class="pay-button" @click="onPay">支付运费</button>
					<button class="reserve-button" @click="onReserve">稍后预存</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';

	// 将所有数字数据包装成一个对象
	const paymentInfo = ref({
		feeAmount: 100.00, // 运费金额
		taxFee: 40000, // 含税运费
		depositFee: 4000, // 保证金
		availableBalance: 10000000 // 可用余额
	});
</script>

<style lang="scss">
	.box {
		background-color: #002fa7;
	}

	.box_top {
		line-height: 130rpx;
		padding-left: 40rpx;
		font-size: 40rpx;
		color: #fff;
	}

	.content {
		height: 88vh;
		display: flex;
		justify-content: center;
		/* 水平居中 */
		align-items: center;
		/* 垂直居中 */
		flex-direction: column;
	}

	.content_shang {
		width: 100%;
		height: 75%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		color: #fff;
	}

	.zhong {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 600rpx;
		padding: 20rpx;
		border-radius: 10rpx;
	}

	.zhong_shang {
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-bottom: 20rpx;
		color: #627fc9;
		margin-top: -120rpx;
		padding-bottom: 30rpx;
	}

	.shang_text {
		font-size: 25rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		margin-bottom: 10rpx;
	}

	.zhong_zhong {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		margin-bottom: 50rpx;
	}

	.zhong_text {
		font-size: 30rpx;
		font-weight: bold;
		text-align: center;
	}

	.zhong_xia {
		display: flex;
		flex-direction: column;
		width: 100%;
		margin-bottom: 20rpx;
	}

	.fee_details {
		display: flex;
		justify-content: center;
		align-items: center;
		margin-bottom: 20rpx;
		color: #627fc9;
		font-size: 25rpx;
	}

	.amount {
		font-size: 50rpx;
		font-weight: bold;
		color: #fff;
		margin-left: 10rpx;
	}

	.balance {
		font-size: 28rpx;
		font-weight: bold;
		margin-top: 20rpx;
	}

	.balance :nth-child(1) {
		margin-right: 23rpx;
	}

	.content_xia {
		width: 100%;
		background-color: #eeeeee;
		border-radius: 20rpx 20rpx 0 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		height: 25vh;

	}

	.buttons {
		width: 100%;
		padding: 0 20rpx;
		display: flex;
		flex-direction: column;
		gap: 20rpx;
	}

	button {
		width: 100%;
		padding: 15rpx;
		font-size: 36rpx;
		border-radius: 10rpx;
		text-align: center;
	}

	.pay-button {
		background-color: #002fa7;
		color: white;
		border: none;
		width: 500rpx;
		margin-top: 30rpx;
	}

	.reserve-button {
		background-color: #f0f0f0;
		color: #007aff;
		border: 1px solid #007aff;
		width: 500rpx;
	}
</style>